/*********************************************************************
----------------------------------------------------------------------
File        : par set.h
Purpose     : Display driver configuration file
----------------------------------------------------------------------
*/

#ifndef WIN_SYS_PAR_SET_H_
#define WIN_SYS_PAR_SET_H_

#include "DIALOG.h"
#include "mytype.h"
#include "par_tab.h"

#define WIDGET_TYPE_TEXT        1
#define WIDGET_TYPE_SPIN        2
#define WIDGET_TYPE_RADIO       3
#define WIDGET_TYPE_DROPDOWN    4
#define WIDGET_TYPE_ICON        5

struct par_rw_str
{
	void(*set)(const struct par_info_str * inf, ii32 par_val);
	int32_t (*get)(const struct par_info_str * inf);
};

typedef struct par_rw_str par_rw_type;

struct par_info_str
{
	ii8 widget_type;
	par_code_info_type *fore_txt_name;
	uu16 fore_txt_wide;
	uu16 par_num;
	uu16 x0, y0, wide, high;
	uu32 info;
	const par_rw_type * callback;
};

#define WG_X0 25
#define WG_Y0 80
#define WG_W  180
#define WG_H  40
#define WG_X_SPC 400
#define WG_Y_SPC 50

typedef struct par_info_str par_info_type;


int par_widget_add(
	GUI_WIDGET_CREATE_INFO *dialog_list,
	const GUI_WIDGET_CREATE_INFO *_aDialogCreate,
	int count,
	par_info_type * par_info
	);

void par_widget_init(WM_MESSAGE * pMsg, par_info_type * par_info);
void par_widget_notify(WM_MESSAGE * pMsg, int id, par_info_type * par_info);

extern const par_info_type * * const par_list[];

extern const par_rw_type sys_par_opt;

#endif /* WIN_SYS_PAR_SET_H_ */

/*************************** End of file ****************************/
